varying vec3 pos;
varying vec2 texCoord;
uniform sampler2D cloud;
uniform vec3 center;

float module(vec3 a, vec3 b) {
    vec3 c = a - b;
    return sqrt(c.x*c.x + c.y*c.y + c.z*c.z);
}

void main(void) {
    vec4 color = texture2D(cloud,texCoord);
    float fren = module(center,pos);
    fren += 1.0;
    fren /= 90.0;
    fren = 1.0 - min(1.0,fren);
    color.w *= fren*0.3;
    color.x = 0.5;
    color.y = 0.5;//*fren;
    color.z = 0.5;
    gl_FragColor = color;
}
